$(function () {
//城市下拉框
	$('#city_box').combo({
		//width : 300,
		height : 25,
		//panelWidth : 300,
		//panelHeight : 50,
		//editable : false,
		//disabled : true,
		//readonly : true,
		//hasDownArrow : false,
		//value : '123',
		//delay : 1000,
		/*
		onShowPanel : function () {
			alert('显示触发');
		},
		onHidePanel : function () {
			alert('隐藏触发');
		},
		
		onChange : function (newValue, oldValue) {
			alert(newValue + '|' + oldValue);
		},
		*/
		required : true,
	});
	
	$('#city').appendTo($('#city_box').combo('panel'));
	$('#city_box').combo('setText',"北京");
	$('#city input').click(function () {
		var v = $(this).val();
		var s = $(this).next('span').text();
		$('#city_box').combo('setValue', v).combo('setText', s).combo('hidePanel');
	});
	
	//console.log($('#box').combo('textbox'));
	
	$(document).click(function () {
		//$('#box').combo('resize', 'width');
		//$('#box').combo('showPanel');
		//console.log($('#box').combo('isValid'));
		//console.log($('#box').combo('getText'));
		//console.log($('#box').combo('getValue'));
		$('#city_box').combo('setValues', ['1','2','3']);
		console.log($('#city_box').combo('getValues'));
	});
//搜索框
	$('#ss').searchbox({
		width : 300,
		height : 22,
		menu : '#box',
		searcher : function (name, value) {
			alert(name + '-' + value);
		},
		prompt : '请输入关键字',
		// value : '秦风阁',
		//disabled : true,
	});
	
	var m = $('#ss').searchbox('menu');
	m.menu('setIcon', {
		target : m.menu('findItem', '服务').target,
		iconCls : 'icon-ok',
	});
	
	//console.log($('#ss').searchbox('textbox'));
	//console.log($('#ss').searchbox('getValue'));
	//$('#ss').searchbox('setValue', '123');
	//console.log($('#ss').searchbox('getName'));
	//$('#ss').searchbox('selectName', 'sports');
	//$('#ss').searchbox('destroy');
	//$('#ss').searchbox('resize', 500);
	//$('#ss').searchbox('disable');
	//$('#ss').searchbox('enable');
	//$('#ss').searchbox('clear');
	// $(document).dblclick(function () {
	// 	$('#ss').searchbox('reset');
	// });

	
});



	







	









